<template>
  <div class="songer">
    <div class="warpper">
      <div
        class="singerbox"
        @click="ToDetail(i)" 
        v-for="(v, i) in singerList"
        :key="i"
        style="color=red"
 >
        <div class="left">
          <img :src="v.songimg" alt="" />
          <div class="text">
            <p>{{ v.songid}}</p>
            <p>{{ v.songtitle}}</p>
            <p>{{ v.author}}</p>
          </div>
        </div>
        <div class="right">
          <img src="@/assets/myt/singerb.png" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {

    }
  },
  props:['singerList'],
  methods: {
    ToDetail(i) {
      console.log("todetail")
      console.log(i)
      console.log(this.singerList)
      this.$router.push({
        "path": "dl",
        "query": {
            index: i,
            songList: this.singerList
        }
      })
    },
  },
  computed: {
    // arr() {
    //   return this.$route.query.xiaoming;
    // },
  },
//  created () {
//     //在页面加载时读取sessionStorage里的状态信息
//     if (sessionStorage.getItem("store") ) {
//         this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store"))))
//     } 
//     //在页面刷新时将vuex里的信息保存到sessionStorage里
//     window.addEventListener("beforeunload",()=>{
//         sessionStorage.setItem("store",JSON.stringify(this.$store.state))
//     })
//   }
 
};
</script>

<style scoped>
.songer {
  margin-top: 0.2rem;
  width: 100%;
  height: 1.3rem;
  /* background-color: teal; */
}
.warpper {
  margin: 0 auto;
  width: 6.86rem;
  height: 100%;
}
.left {
  display: flex;
  align-items: center;
}
.left > img {
  width: 1.06rem;
  height: 1.06rem;
  vertical-align: middle;
  border-radius: 0.2rem;
}
.singerbox {
  margin: 0.2rem;
  height: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.right {
  height: 1.06rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.right > img {
  width: 0.32rem;
  height: 0.32rem;
  vertical-align: middle;
}
.text {
  display: flex;
  align-items: center;
}
.text > p {
  line-height: 0.53rem;
  text-indent: 1em;
}
.text > p:nth-of-type(1) {
  font-size: 0.2rem;
  font-weight: 600;
  color: #313131;
  width: 1rem;
}
.text > p:nth-of-type(2) {
  font-size: 0.2rem;
  color: #7b7b7d;
}
.text > p:nth-of-type(3) {
  font-size: 0.2rem;
  color: #313131;
  width: 1.2rem;
}

</style>